package com.ldk.admin.controller;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ldk.framework.entity.*;
import com.ldk.framework.service.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.ldk.admin.common.LigerUIGridResult;
import com.ldk.admin.constants.ViewMode;
import com.ldk.base.framework.common.CustomPageable;
import com.ldk.base.framework.util.SystemUtil;
import com.ldk.framework.enums.PlatformUserType;

/**
 * A.4.2、网约车平台公司营运规模信息
 * @author xiangwl
 * 2018年8月9日
 * com.ldk.admin.controller
 * CompanystatController
 */
@Controller
@RequestMapping("/baseinfo")
public class CompanystatController  extends BaseController  {
    /**
     * 路由地址
     */
    private final String route = "baseinfo";
    /**
     * 模块名称
     */
    private final String module = "公司营运规模";
    @Autowired
    private ICompanystatService companystatService;

    @RequestMapping("/companystat")
    public ModelAndView edit(ModelMap map,HttpServletRequest request,
                             HttpServletResponse response){
        //session是否过期
        this.isExpired(request,response);
        setLinks(map, module+"管理", "", "", "", "", "");
        setForm(map, "/"+route+"/companystat/submit", null);
        Companystat query=new Companystat();
        query.setId(1L);
        //Complaint model = complaintService.selectByKey("", query);
        Companystat model = companystatService.selectOne("", query);
        if(model == null){
            //return new ModelAndView("redirect:/"+route+"/list");
            //System.out.println("debug: model=null");
        } else {
            //System.out.println("debug: CompanyId="+model.getCompanyId()+",CompanyName="+model.getDriverNum());
        }
        return new ModelAndView("/"+route+"/companystat/info","model",model);
    }
}
